package com.ktgj.service.controller;

import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.service.domain.City;
import com.ktgj.service.domain.County;
import com.ktgj.service.service.CItyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ControllerAdvice
@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    private CItyService cItyService;

    /**
     * 更新dic_county表数据
     * @param cityDomain
     * @return
     */
    @PostMapping("/county")
    public AjaxResult insertCounty(County cityDomain) {
        return AjaxResult.success(cItyService.insertCounty(cityDomain));
    }

    /**
     * 更新dic_city表数据
     * @param city
     * @return
     */
    @PostMapping("/city")
    public AjaxResult inserCity(City city) {
        return AjaxResult.success(cItyService.insertCity(city));
    }
}
